#ifndef _DVMH_SYSTEM_TYP_H_
#define _DVMH_SYSTEM_TYP_H_

#include <mpi.h>
#define rec struct {
#define endrec } 
#define MAXARRAYDIM           7 /* max. rank of 
                                          distributed array */    /*E0007*/ 
#define MaxParFileName      128 /* maximal size of 
                                   parameter file name */    /*E0014*/ 

typedef rec

void          *BasePtr;         /* */    /*E0055*/
unsigned long  HeaderPtr;       /* pointer to array header
                                   or Type field repetition */    /*E0056*/
void          *NextHandlePtr;   /* pointer to the next Handle or NULL,
                                   used to arrange distributed array
                                   edge group buffers */    /*E0057*/
unsigned char  Type;            /* type of an object */    /*E0058*/
int            EnvInd;          /* index of context 
                                   in which the object has been created;
                                   or -1 for static object;
                                   current context index - for anabstract
                                   machine and for parallel loop */    /*E0059*/
int            CrtEnvInd;       /* index of context in which the object
                                   has been created */    /*E0060*/
int            InitCrtBlockInd; /* */    /*E0061*/
int            CrtBlockInd;     /* */    /*E0062*/
void          *CrtAMHandlePtr;  /* pointer to Handle of an abstract machine
                                   of subtask that create the object */    /*E0063*/
long           lP;              /* number of processor element (sht_VProc) in 
                                   initial processor system;
                                   linear number of an abstract machine (sht_AMS)
                                   in its parent abstract machine representation;
                                   NULL for other objects */    /*e0064*/
void          *pP;              /* pointer to data that depends on
                                   object's type; for processor element
                                   (sht_VProc) - NULL */    /*E0065*/
endrec  SysHandle; 

#define MPS_Request MPI_Request 
#define MPS_Status  MPI_Status 

typedef rec

unsigned char  SendSign;   /* */    /*E0030*/
int          ProcNumber;   /*inner processor number which send or receive messages  */    /*E0031*/
double       SendRecvTime; /*time of beginning of  NO WAIT exchange  */    /*E0032*/
char        *BufAddr;      /*address of sent or received message */    /*E0033*/
long         BufLength;    /*length  of sent or received message */    /*E0034*/
MPS_Status   Status;       /* */    /*E0035*/
MPS_Request  MPSFlag;      /*MPS- exchange flag */    /*E0036*/

/* */    /*E0037*/

int          FlagNumber;   /* */    /*E0038*/
MPS_Request *MPSFlagArray; /* */    /*E0039*/
unsigned char *EndExchange;/* */    /*E0040*/

/* */    /*E0041*/

int MsgLength; /* */    /*E0042*/
int Remainder; /* */    /*E0043*/
int Init;      /* */    /*E0044*/
int Last;      /* */    /*E0045*/
int Chan;      /* */    /*E0046*/
int tag;       /* */    /*E0047*/
int CurrOper;  /* */    /*E0048*/

/* */    /*E0049*/

char          *CompressBuf;      /* */    /*E0050*/
int            ResCompressIndex; /* */    /*E0051*/ 
int            CompressMsgLen;   /* */    /*E0052*/
unsigned char  IsCompressSize;   /* */    /*E0053*/

endrec RTL_Request; 

typedef unsigned long AddrType;       /* address type defined as unsigned long */    /*E0018*/  
typedef unsigned long ShadowGroupRef; /* reference to a shadows group */    /*E0013*/ 
typedef unsigned long LoopRef;        /* reference to parallel loop */    /*E0010*/ 
typedef unsigned long RedRef;

#define align_REPLICATE   1

/* Named reduction constants */    /*E0004*/

#define rf_SUM       1
#define rf_PROD      2
#define rf_MULT      2
#define rf_MAX       3
#define rf_MIN       4
#define rf_AND       5
#define rf_OR        6
#define rf_XOR       7
#define rf_EQU       8
#define rf_NE        9
#define rf_EQ       10
#define rf_MAXLOC   11
#define rf_MINLOC   12

#define rt_CHAR              0
#define rt_INT               1
#define rt_LONG              2
#define rt_FLOAT             3
#define rt_DOUBLE            4
#define rt_FLOAT_COMPLEX     5
#define rt_DOUBLE_COMPLEX    6
#define rt_LOGICAL           7

#include "system.typ"

#endif
